import React,{lazy} from 'react'
import {Navigate} from 'react-router-dom'
const Home=lazy(()=>import('../pages/home'))
const List=lazy(()=>import('../pages/list'))
const User=lazy(()=>import('../pages/user'))
const Set=lazy(()=>import('../pages/set'))
const Login=lazy(()=>import('../pages/login'))
const Text=lazy(()=>import('../pages/text'))
const MainLayout=lazy(()=>import('../mainLayout'))
// 2.根据素材搭建路由配置12:12
// 3.根据素材正确封装所需的路由表12:12
export default [{
    path:'/',
    element:<MainLayout></MainLayout>,
    children:[{
        path:'/',
        element:<Navigate to="/home"></Navigate>
    },{
        path:'/home',
        element:<Home></Home>
    },{
        path:'/list',
        element:<List></List>
    },{
        path:'/user',
        element:<User></User>
    },{
        path:'/set',
        element:<Set></Set>
    },]
},{
    path:'/text:id',
    element:<Text></Text>
},{
    path:'/login',
    element:<Login></Login>
}]